jQuery.noConflict();
(function(a){
    if(a.com){
        if(a.com.stilva){
            a.extend(a.com.stilva,{
                animBackground:{}
            })
        }else{
        a.extend(a.com,{
            stilva:{
                animBackground:{}
        }
        })
}
}else{
    a.com={
        stilva:{
            animBackground:{}
    }
}
}
a.fn.animBackground=function(f,c){
    var b=this;
    var e=/([\d]+)[^\s]+[\s]+([\d]+)[^\s]+/ig;
    if(typeof f!=="number"){
        if(f==="clear"){
            return clearInterval(a.com.stilva.animBackground[b.selector])
            }else{
            return Boolean(a.com.stilva.animBackground[b.selector])
            }
        }
    f=(f)?f*1000:1000;
var d={
    ease:"easeOutExpo",
    x:0,
    y:0,
    onComplete:null,
    override:false
};

return this.each(function(i){
    if(c){
        a.extend(d,c)
        }
        if(a.com.stilva.animBackground[b.selector]){
        clearInterval(a.com.stilva.animBackground[b.selector].intervalID);
        a.com.stilva.animBackground[b.selector].currentTime=(d.override)?a.com.stilva.animBackground[b.selector].currentTime:0
        }else{
        a.com.stilva.animBackground[b.selector]={
            intervalID:null,
            currentTime:0
        }
    }
    var g=(b.css("background-position"))?e.exec(b.css("background-position")):[0,0,0];
    g=(!g||g===null)?[0,0,0]:g;
    var h={
    x:Number(g[1]),
    y:Number(g[2])
    };
    
a.com.stilva.animBackground[b.selector].intervalID=setInterval(function(){
    a.com.stilva.animBackground[b.selector].currentTime+=41;
    b.css("background-position",a.easing[d.ease]("",a.com.stilva.animBackground[b.selector].currentTime,h.x,d.x-h.x,f)+"px "+a.easing[d.ease]("",a.com.stilva.animBackground[b.selector].currentTime,h.y,d.y-h.y,f)+"px");
    if(a.com.stilva.animBackground[b.selector].currentTime>f){
        clearInterval(a.com.stilva.animBackground[b.selector].intervalID);
        a.com.stilva.animBackground[b.selector]=null;
        b.css({
            "background-position":d.x+"px "+d.y+"px"
            });
        if(d.onComplete instanceof Function){
            d.onComplete.call(b)
            }
        }
},41)
})
}
})(jQuery);
var getCSS_TOP="place the css before all css'";
var getCSS_BOTTOM="place the css after all css'";
(function(a){
    a.fn.getCSS=function(c,b,e,f){
        var d=a("<link />");
        switch(b){
            case getCSS_TOP:
                d=d.insertBefore(a("head").find("link").first());
                break;
            case getCSS_BOTTOM:default:
                d=d.insertAfter(a("head").find("link").last())
                }
                a.ajax({
            url:c,
            success:function(g){
                d.attr({
                    rel:"stylesheet",
                    type:"text/css",
                    href:c,
                    media:"all"
                });
                if(e){
                    e(f)
                    }
                }
        })
}
})(jQuery);
(function(a){
    a.fn.getData=function(h,g){
        var d,b,e=[];
        if(!(h instanceof Array)){
            alert("getData needs an Array");
            return
        }else{
            if(!g){
                alert("oopsies, I need someone to respond to:: second element");
                return
            }
        }
        d=0;
    b=h.length;
    function f(i){
        a.ajax({
            url:i.url,
            success:function(j){
                switch(i.type){
                    case"js":
                        e.push({
                        data:'\n<script src="'+i.url+'"><\/script>',
                        type:i.type
                        });
                    break;
                    case"json":
                        e.push({
                        data:j,
                        type:i.type,
                        obj:i.obj
                        });
                    break;
                    case"xml":
                        break;
                    case"html":
                        e.push({
                        data:escape(j),
                        type:i.type,
                        obj:i.obj
                        });
                    break;
                    default:
                        alert("getData only accepts js|json|xml. File with the type: "+i.type+", and the url: "+i.url)
                        }
                        c()
                }
            })
    }
    f(h[d]);
    function c(){
    if(d+1<b){
        a(this).trigger("b");
        f(h[++d])
        }else{
        g(e)
        }
    }
}
})(jQuery);/*!
 * imagePreloader jQuery Plugin v0.6.1
 * http://www.stilva.com/
 *
 * Copyright 2011, Thomas.A
 */
(function(d){
    var b="IMAGEPRELOADER_LOADED";
    var e="IMAGEPRELOADER_COMPLETE";
    var a="MODE_BATCH";
    var c="MODE_QUEUED";
    if(d.com){
        if(d.com.stilva){
            d.extend(d.com.stilva,{
                imagePreloader:{}
            })
        }else{
        d.extend(d.com,{
            stilva:{
                imagePreloader:{}
        }
        })
}
}else{
    d.com={
        stilva:{
            imagePreloader:{}
    }
}
}
d.fn.imagePreloader=function(g,f,i){
    var h=this;
    i=(i===null)?a:i;
    return this.each(function(){
        var p=0,o=f.length,s=0,m,j;
        var q=[];
        var n=[];
        function r(l){
            n.push({
                id:l,
                src:f[l],
                ref:new Image()
                });
            d(n[l].ref).bind("load.imagePreloader",{
                i:l
            },k).attr("src",f[l])
            }
            function k(l){
            s++;
            m=n[l.data.i].id;
            j=f[l.data.i];
            d(n[l.data.i].ref).unbind("load.imagePreloader");
            q.push([m,j]);
            if(i===c){
                if(q.length===f.length){
                    h.trigger(e+"."+g,[q]);
                    n=q=""
                    }else{
                    h.trigger(b+"."+g,[Number(m),j]);
                    r(++m)
                    }
                }else{
            if(q.length===f.length){
                h.trigger(e+"."+g,[q]);
                n=q=""
                }else{
                h.trigger(b+"."+g,[Number(m),j])
                }
            }
    }
    for(p;p<((i===a)?o:1);p++){
    r(p)
    }
})
}
})(jQuery);
(function(a){
    a.fn.rotate3d=function(b){
        var c={
            image:null,
            ny:0,
            interval:0,
            scope:this,
            front:null,
            back:null
        };
        
        return this.each(function(){
            if(b){
                a.extend(c,b)
                }
                if(c.image){
                alert("")
                }
                c.scope=this;
            a(this).css({
                webkitTransform:"rotateY(180deg)",
                "webkitBox-sizing":"border-box",
                "webkitTransform-style":"preserve-3d",
                webkitTransition:"all 1.0s linear"
            })
            })
        }
    })(jQuery);
(function(a){
    if(a.com){
        if(a.com.stilva){
            a.extend(a.com.stilva,{
                scroller:{
                    intervalID:null
                }
            })
        }else{
        a.extend(a.com,{
            stilva:{
                scroller:{
                    intervalID:null
                }
            }
        })
}
}else{
    a.com={
        stilva:{
            scroller:{
                intervalID:null
            }
        }
    }
}
a.fn.scroller=function(f,c){
    var b=this;
    var e=a(window);
    f=(f)?f*1000:1000;
    var d={
        ease:"easeInExpo",
        offset:0,
        measurement:"offset",
        onComplete:null,
        onUpdate:null
    };
    
    return this.each(function(j){
        if(c){
            a.extend(d,c)
            }
            if(a.com.stilva.scroller.intervalID){
            clearInterval(a.com.stilva.scroller.intervalID)
            }
            var i=0;
        var h=e.scrollTop();
        var g=b[d.measurement]().top-d.offset;
        a.com.stilva.scroller.intervalID=setInterval(function(){
            i+=41;
            e.scrollTop(a.easing[d.ease]("",i,h,g-h,f));
            if(i>f){
                clearInterval(a.com.stilva.scroller.intervalID);
                a.com.stilva.scroller.intervalID=null;
                e.scrollTop(g);
                if(d.onComplete instanceof Function){
                    d.onComplete()
                    }
                }
        },41)
    })
}
})(jQuery);
(function(a){
    a.fn.unselectable=function(){
        if(!a.browser.msie){
            this.css({
                "-moz-user-select":"-moz-none",
                "-khtml-user-select":"none",
                "-webkit-user-select":"none",
                "-o-user-select":"none",
                "user-select":"none"
            })
            }else{
            this.bind("dragstart selectstart",function(b){
                b.preventDefault()
                })
            }
        }
})(jQuery);
(function(a){
    a.fn.getHiddenDimensions=function(e){
        var d=this,f={
            position:"absolute",
            visibility:"hidden",
            display:"block"
        },g={
            width:0,
            height:0,
            innerWidth:0,
            innerHeight:0,
            outerWidth:0,
            outerHeight:0
        },c=d.parents().andSelf().not(":visible"),e=(e==null)?false:e;
        var b=[];
        c.each(function(){
            var h={};
            
            for(var i in f){
                h[i]=this.style[i];
                this.style[i]=f[i]
                }
                b.push(h)
            });
        g.width=d.width();
        g.outerWidth=d.outerWidth(e);
        g.innerWidth=d.innerWidth();
        g.height=d.height();
        g.innerHeight=d.innerHeight();
        g.outerHeight=d.outerHeight(e);
        c.each(function(k){
            var h=b[k];
            for(var j in f){
                this.style[j]=h[j]
                }
            });
    return g
    }
}(jQuery));
var Section,Contactus,Technical,Products,Gallery,Projects,Banner,Menu,About,Gallas;
var win;
var _show="main";
var intro_button;
var section,contactus,technical,products,gallery,projects,banner,menu,about;
var _ignoreScroll=false;
var console=console?console:{
    log:function(){}
};

onInit=function(){
    Section=Objs("com.stilva.jwi.section.Section");
    // Menu=Objs("com.stilva.jwi.utils.Menu");
    // Gallas=Objs("com.stilva.jwi.section.Gallas");
    // Contactus=Objs("com.stilva.jwi.section.Contactus");
    Banner=Objs("com.stilva.jwi.section.Banner");
    // About=Objs("com.stilva.jwi.section.About");
    // Projects=Objs("com.stilva.jwi.section.Projects");
    // Gallery=Objs("com.stilva.jwi.section.Gallery");
    // Products=Objs("com.stilva.jwi.section.Products");
    // Technical=Objs("com.stilva.jwi.section.Technical");
    // $.address.state("/");
    // intro_button=jQuery("#intro-button");
    // intro_button.bind("click",onIntroButtonHandler);
    section=new Section("section");
    // menu=new Menu();
    // contactus=new Contactus("contact-us");
    banner=new Banner("main",jQuery("section#main"));
    // about=new About("about",jQuery("section#about"));
    // projects=new Projects("project");
    // gallery=new Gallery("gallery",_imgs);
    // products=new Products("products");
    // technical=new Technical("technical");
    win=jQuery(window);
    // win.bind("scroll",onScrollHandler);
    // win.bind("resize.intro",onIntroResizeHandler);
    // jQuery(document).bind("mousemove.intro",onIntroMouseHandler);
    // onIntroResizeHandler(null);
    // jQuery("#contact-us-button a").bind("click",function(a){
        // a.preventDefault();
        // contactus.show(0)
        // });
    // menu.init(jQuery("div#nav-wrapper"));
    // menu.addMenus("#menu-about","#menu-project","#menu-gallery","#menu-products","#menu-technical");
    // intro_button.find("> a").css({
        // display:"block",
        // opacity:"0"
    // }).animate({
        // opacity:1
    // },400);
    // if(_URL.length>0){
        // onIntroButtonHandler({
            // preventDefault:function(){}
        // })
    // }
};
    
onBlackened=function(){
    jQuery("body").css("background-color","#EDEEF0");
    jQuery("#intro-image img").css("display","none");
    jQuery("#intro-button").css("display","none");
    //gallery.init(jQuery("section#gallery"));
    // technical.init(jQuery("section#technical"));
    // products.init(jQuery("section#products"));
    // projects.init(jQuery("section#project"));
    banner.init();
    //about.init();
    jQuery("#intro-image").delay(250).animate({
        height:"0"
    },300,"easeOutExpo");
    jQuery("#nav-wrapper nav").css({
        height:jQuery("#nav-background").height()
        }).delay(100).animate({
        height:"0px"
    },300,"easeOutExpo",function(){
        jQuery("#nav-wrapper nav div").each(function(c,b){
            jQuery(b).css("display","block")
            })
        }).delay(275).animate({
        height:"215px"
    },375,"easeInExpo");
    jQuery("#nav-background").delay(100).animate({
        height:"0px"
    },300,"easeOutExpo").delay(275).animate({
        height:"215px"
    },375,"easeInExpo",onMenuShown);
    if(_URL.length===0){
        banner.show()
        }else{
        section.setCurrent(banner);
        var a=_URL.split("/");
        a.shift();
        a[0]=a[0];
        menu._onMouseHandler({
            type:"externalChange",
            pathNames:a,
            preventDefault:function(){}
        },_URL)
    }
    //$.address.externalChange(function(b){
    // menu._onMouseHandler(b,b.value)
    // });
// jQuery("section#about div.dotted-line").css({
    // height:(50)+"px"
// }).find("div.black-block").last().css({
    // top:"64px"
// });
// win.bind("resize",onResizeHandler);
    // onResizeHandler(null)
     };
    
onMenuShown=function(){
    jQuery("#header").css("display","block");
    jQuery("#awwwards a").css("visibility","visible");
    jQuery("#nav-background").delay(1000).animate({
        height:"77px"
    },450,"easeOutExpo");
    jQuery("#nav-wrapper nav").delay(1000).animate({
        height:"77px"
    },450,"easeOutExpo",function(){
        jQuery("#nav-wrapper nav").bind("mouseenter mouseleave",onMenuHandler)
        })
    };
    
onMenuHandler=function(a){
    switch(a.type){
        case"mouseenter":
            jQuery("#nav-background").stop(false).animate({
            height:"215px"
        },450,"easeOutExpo");
        jQuery("#nav-wrapper nav").stop(false).animate({
            height:"215px"
        },450,"easeOutExpo");
        break;
        case"mouseleave":
            jQuery("#nav-background").stop(false).animate({
            height:"77px"
        },450,"easeOutExpo");
        jQuery("#nav-wrapper nav").stop(false).animate({
            height:"77px"
        },450,"easeOutExpo");
        break
        }
        };

var Menu=Objs("com.stilva.jwi.utils.Menu",{
    win:null,
    self:null,
    selected:null,
    selectedTargetID:null,
    pattern:/menu-([\w]+)/ig,
    currentID:0,
    items:[],
    initialize:function(){
        var a=this
        },
    init:function(a){
        var b=this;
        this.self=a;
        this.self.find("> nav div#menu-logo").bind("click",function(c){
            b._onMouseHandler(c)
            })
        },
    select:function(c){
        var b=0;
        var a=this.items.length;
        c=(c.substr(0,1)==="#")?c:"#"+c;
        this.unselect();
        for(b;b<a;b++){
            if(this.items[b]===c){
                this.currentID=b;
                this.selected=jQuery(this.items[b]).find("> h1");
                this.selected.removeClass("selected").css("background-position","0 77px").addClass("selected");
                this.selected.animBackground(0.25,{
                    y:0,
                    ease:"easeInExpo"
                });
                break
            }
        }
        },
unselect:function(){
    if(this.selected){
        this.selected.animBackground(0.25,{
            y:77,
            onComplete:function(){
                this.removeClass("selected")
                }
            });
    this.selected=null
    }
},
addMenu:function(a){
    this.items.push(a)
    },
addMenus:function(){
    var b=0,a=arguments.length,c=this;
    for(b;b<a;b++){
        this.items.push(arguments[b]);
        this.self.find("div"+arguments[b]+" ul > li > a").bind("click",function(d){
            c._onMouseHandler(d,jQuery(this).attr("rel"))
            });
        this.self.find("div"+arguments[b]+" > h1").bind("click",function(d){
            c._onMouseHandler(d)
            })
        }
    },
setValue:function(a){
    $.address.value(a)
    },
_onMouseHandler:function(f,a){
    f.preventDefault();
    var c=this,b;
    this.pattern.lastIndex=0;
    if(f.type!=="externalChange"){
        b=(f.currentTarget.id==="menu-logo")?"main":this.pattern.exec(f.currentTarget.offsetParent.id)[1]
        }else{
        b=(f.pathNames.length===0)?"main":f.pathNames[0]
        }
        var d=section.getFromID(b);
    a=(!a)?d.self.find("nav.sub-menu > ul > li > a").first().attr("rel"):a;
    if(f.type!=="externalChange"){
        if(!a){
            a="/"
            }
            this.setValue(a)
        }
        if(section.getCurrent()&&d!==section.getCurrent()){
        this.select("#menu-"+b);
        section.getCurrent().bind(Section.SECTION_HIDDEN,(d.show).call(d,a));
        section.getCurrent().hide()
        }else{
        if(d===section.getCurrent()){
            (d.show).call(d,a)
            }
        }
}
});
var Section=Objs("com.stilva.jwi.section.Section",{
    _ID:"",
    minHeight:0,
    yOffset:200,
    self:null,
    sub_selected:null,
    initialize:function(a){
        if(!Section.COLLECTION){
            Section.COLLECTION={};
            
            Section.EVENT_LISTENERS={};
            
            Section.SECTION_HIDDEN="SECTION_HIDDEN";
            Section.SECTION_SHOWN="SECTION_SHOWN"
            }
            this._ID=a;
        Section.COLLECTION[a]=this
        },
    init:function(c,b){
        var a=this;
        this.self=c;
        this.self.find("nav.sub-menu > ul li a").live("click dummyClick",function(d){
            d.preventDefault();
            a._onSubMenuHandler(d)
            });
        Cufon.replace("div.dotted-line a.canvasgroup",{
            fontFamily:"avenir",
            hover:"true"
        })
        },
    trigger:function(e,f){
        var c=Section.EVENT_LISTENERS.ename;
        if(!c||c===undefined){
            return
        }
        var d=0,b=c.length;
        for(d;d<b;d++){
            if(c[d]){
                c[d](f)
                }
            }
        },
bind:function(a,b){
    if(Section.EVENT_LISTENERS.ename){
        Section.EVENT_LISTENERS.ename.push(b)
        }else{
        Section.EVENT_LISTENERS.ename=[b]
        }
    },
unbind:function(e){
    var c=Section.EVENT_LISTENERS.ename;
    if(!c){
        return
    }
    var d=0,b=c.length;
    for(d;d<b-1;d++){
        c[d]=c[d+1]
        }
        if(c.length>1){
        c.pop()
        }else{
        Section.EVENT_LISTENERS.ename=null
        }
        return
},
resize:function(b){
    var a=this.minHeight+this.yOffset;
    jQuery("body").css({
        height:(win.height()<a?a:win.height())+"px"
        })
    },
getCurrent:function(){
    return Section.CURRENT
    },
setCurrent:function(a){
    Section.CURRENT=a
    },
getFromID:function(a){
    return Section.COLLECTION[a]
    },
show:function(e){
    var b=this;
    console.log("Section::show",e);
    this.trigger(Section.SECTION_SHOWN,{
        currentTarget:this
    });
    if(this.sub_selected&&this.sub_selected.attr("rel")===e){
        return
    }
    var c=new RegExp(this._ID+"/([^/]+)","ig");
    var d=c.exec(e);
    if(d){
        var a=this.self.find('nav.sub-menu > ul > li > a[rel="/'+d[0]+'"]');
        a.trigger("dummyClick")
        }
        if(this.getCurrent()===this){
        return
    }
    this.self.css({
        top:(screen.height-200)+"px",
        display:"block"
    }).animate({
        top:this.yOffset+"px"
        },750,"easeOutExpo",function(){
        b.setCurrent(b)
        });
    this.resize()
    },
hide:function(){
    var a=this;
    Section.CURRENT=null;
    if(this.sub_selected){
        this.sub_selected.removeClass("selected");
        this.sub_selected=null
        }
        this.self.animate({
        top:(-this.self.height())+"px"
        },750,"easeOutExpo",function(){
        a.unbind(Section.SECTION_HIDDEN);
        a.trigger(Section.SECTION_HIDDEN,{
            currentTarget:a
        })
        })
    },
_onSubMenuHandler:function(c){
    var b=jQuery(c.currentTarget);
    var a=b.attr("rel");
    if(b.hasClass("selected")){
        return
    }
    if(c.type==="click"||c.currentTarget!==c.target){
        $.address.value(a)
        }
        if(this.sub_selected){
        this.sub_selected.removeClass("selected")
        }
        this.sub_selected=jQuery(c.currentTarget);
    this.sub_selected.removeClass("selected").addClass("selected");
    // Cufon.replace("nav.sub-menu ul li a",{
        // hover:"true"
    // })
    }
});
var Banner=Objs("com.stilva.jwi.section.Banner","com.stilva.jwi.section.Section",{
    yOffset:0,
    banner:null,
    height:490,
    currentNb:0,
    swapInterval:0,
    innerInterval:0,
    initInterval:0,
    transform:null,
    initHover:false,
    IE7XOffset:0,
    initialize:function(c,b){
        Banner.$super.initialize.call(this,c);
        var a=this;
        this.minHeight=805;
        this.currentNb=Math.round(Math.random()*2);
        this.currentNb=0;
		this.self=b;
        this.self.find("div.dotted-line").css({
            height:(50)+"px"
        }).find("div.black-block").last().css({
            top:"24px"
        });
        this.transform={
            WebkitTransform:"-webkit-transform",
            MozTransform:"-moz-transform",
            OTransform:"-o-transform",
            msTransform:"-ms-transform",
            transform:"transform"
        }
    },
attachListeners:function(){
    var a=this;
    this.swapInterval=setInterval(function(){
        a.initAnimation()
        },10000)
    },
removeListeners:function(){
    console.log("removeLIsteners called");
    clearInterval(this.swapInterval);
    clearInterval(this.innerInterval);
    clearInterval(this.initInterval)
    },
init:function(){
    this.dispImages()
    },
dispImages:function(){
    var d=2,b=3,c;
    var a=["left","middle","right"];
    for(;d>=0;d--){
        // c='<div class="img-menu"><h1>'+ images[d][2];
		// c+="</h1><h2>"+images[d][3];
		// c+='</h2></div><img class="bw-image" src="'+images[d][0];
		// c+='"><img class="big-image" src="'+images[d][1]+'">';
		//alert(this.currentNb);
		c='\r\n\t<div class="img-menu">\r\n\t\t<h1>'+data[this.currentNb][a[d]].name;
        c+="</h1>\r\n\t\t<h2>"+data[this.currentNb][a[d]].type;
        c+='</h2>\r\n\t</div>\r\n\t<img class="bw-image" src="'+data[this.currentNb][a[d]].bwImage;
        c+='">\r\n\t<img class="big-image" src="'+data[this.currentNb][a[d]].colourImage+'">\r\n';
        jQuery("section#main div.wrapper div#img-"+(d+1)).append(c)
        }
        // Cufon.replace("h1, h2",{
        // fontFamily:"avenir"
    // })
    },
show:function(){
    if(this.getCurrent()&&this.getCurrent()._ID==="main"){
        return
    }
    Banner.$super.show.call(this,0);
    this.removeListeners();
    this.attachListeners();
    var a=this;
    this.initInterval=setInterval(function(){
        console.log("show initAnimation() called");
        a.initAnimation()
        },this.initHover?1500:2500)
    },
hide:function(){
    Banner.$super.hide.call(this);
    jQuery("div#animation-container").html("");
    this.removeListeners()
    },
initAnimation:function(){
    clearInterval(this.initInterval);
    //var d=this,e=2;
	var d=this,e=(this.currentNb+1===2)?0:this.currentNb+1;
    currentPics=[data[this.currentNb].left.bwImage,data[this.currentNb].middle.bwImage,data[this.currentNb].right.bwImage];
    newPics=[data[e].left.bwImage,data[e].middle.bwImage,data[e].right.bwImage];
    // currentPics=[images[0][0],images[0][0],images[0][0]];
    // newPics=[images[1][0],images[1][0],images[1][0]];
    var c=jQuery('<div id="rotating-content"></div>').appendTo(jQuery('<div id="tmp-container"></div>').appendTo("div#animation-container"));
    var b=0,a=currentPics.length;
    for(;b<a;b++){
        c.append("<div "+(b===0?'id="first-facet"':"")+'class="facet"><div class="left-facet"><img src="'+currentPics[b]+'"></div><div class="right-facet"><img src="'+newPics[b]+'"></div></div><div class="facet"><div class="left-facet"><img src="'+currentPics[b]+'"></div><div class="right-facet"><img src="'+newPics[b]+'"></div></div>')
        }
        jQuery("div.banner-image").css({
        visibility:"hidden"
    });
    if(jQuery.browser.version==="7.0"&&jQuery.browser.msie){
        this.IE7XOffset=-405;
        jQuery(".facet:odd div img").css({
            position:"absolute",
            left:"-162px"
        })
        }
        jQuery(".facet").each(function(f){
        jQuery(this).css({
            left:(f*162+d.IE7XOffset)+"px",
            top:(f*-528)+"px"
            })
        });
    jQuery(".facet div.right-facet").css({
        zIndex:-777
    });
    if(Modernizr.csstransforms3d){
        this.swap3DImages()
        }else{
        this.swapImages()
        }
    },
swapImages:function(){
    var b=1,a=this;
    this.innerInterval=setInterval(function(){
        jQuery(".facet:nth-child("+b+") div.left-facet img").delay(b*100).animate({
            opacity:0
        },550,"easeInExpo",function(){
            jQuery(this).css("visibility","hidden")
            });
        b++;
        if(b===7){
            clearInterval(a.innerInterval);
            setTimeout(a.imagesSwapped,1100)
            }
        },165)
},
swap3DImages:function(){
    var b=1,a=this;
    this.innerInterval=setInterval(function(){
        jQuery(".facet:nth-child("+b+")").css({
            visibility:"visible"
        });
        jQuery(".facet:nth-child("+b+") div.left-facet").css(a.transform[Modernizr.prefixed("transform")],"rotateY(180deg)");
        jQuery(".facet:nth-child("+b+") div.right-facet").css(a.transform[Modernizr.prefixed("transform")],"rotateY(0deg)");
        b++;
        if(b===7){
            clearInterval(a.innerInterval);
            setTimeout(a.imagesSwapped,650)
            }
        },165)
},
imagesSwapped:function(){
    var a=window.banner;
    if(!a.initHover){
        a.self.find("div#img-1").bind("click mouseenter mouseleave",["img-1"],function(b){
            a._onBannerHandler(b)
            });
        a.self.find("div#img-2").bind("click mouseenter mouseleave",["img-2"],function(b){
            a._onBannerHandler(b)
            });
        a.self.find("div#img-3").bind("click mouseenter mouseleave",["img-3"],function(b){
            a._onBannerHandler(b)
            });
        a.initHover=true
        }
        window.banner.currentNb=(window.banner.currentNb+1===2)?0:window.banner.currentNb+1;
    jQuery("div.banner-image").css({
        visibility:"visible"
    });
    jQuery("section#main div.wrapper div#img-1").html("");
    jQuery("section#main div.wrapper div#img-2").html("");
    jQuery("section#main div.wrapper div#img-3").html("");
    window.banner.dispImages();
    jQuery("div#animation-container").animate({
        opacity:"0"
    },750,"easeInExpo",function(){
        jQuery(this).html("");
        jQuery(this).animate({
            opacity:"1"
        },0)
        })
    },
_onBannerHandler:function(h){
    var c=0,f=this;
    var d=jQuery(h.currentTarget);
    var i=d.find("img.bw-image").first();
    switch(h.type){
        case "click":
            var b,g=/\/([^\/]+)\/([^\/]+)\/?([\w-_]+)?/ig;
            if(this.banner!==null){
            switch(h.data[0]){
                case "img-1":
                    b=_banner_json[this.currentNb].left.slug;
                    break;
                case "img-2":
                    b=_banner_json[this.currentNb].middle.slug;
                    break;
                case "img-3":
                    b=_banner_json[this.currentNb].right.slug;
                    break
                    }
                    var a=g.exec(unescape(b));
            if(a){
                window.menu._onMouseHandler({
                    type:"click",
                    currentTarget:{
                        offsetParent:{
                            id:"#menu-"+a[1]
                            }
                        },
                preventDefault:function(){}
                },a[0])
        }
        }
    break;
case "mouseenter":
    if(f.banner){
    c=350
    }
    f.banner=d;
this.removeListeners();
    d.css("z-index",77);
    i.stop(true).animate({
    opacity:0,
    "z-index":77
},350);
d.stop(true).delay(350+c).animate({
    width:648
},350,function(){
    f._onBannerImageShown(d.find("div.img-menu"))
    });
break;
case "mouseleave":
    this.removeListeners();
    this.attachListeners();
    f._onBannerImageHide(d.find("div.img-menu"));
    d.stop(true).animate({
    width:324
},350);
i.stop(true).delay(350).animate({
    opacity:1,
    "z-index":7
},350,function(){
    d.css("z-index",7);
    f.banner=(f.banner&&f.banner.attr("id")===d.attr("id"))?null:f.banner
    });
break
}
},
_onBannerImageShown:function(c){
    c.parent().css({
        cursor:"pointer"
    });
    var b=[c.find("h1"),c.find("h2")];
    for(var a=0;a<2;a++){
        b[a].stop(true).css({
            display:"block",
            opacity:"0"
        }).animate({
            opacity:1
        },125).animate({
            "line-height":b[a].css("font-size")
            },125,"easeOutExpo")
        }
    },
_onBannerImageHide:function(c){
    c.parent().css({
        cursor:"auto"
    });
    var b=[c.find("h1"),c.find("h2")];
    for(var a=0;a<2;a++){
        b[a].stop(true).animate({
            "line-height":"50px"
        },125).animate({
            opacity:0
        },125,function(){
            jQuery(this).css({
                display:"none",
                opacity:"0"
            })
            })
        }
    }
});